<script setup lang="ts">
import { inject } from 'vue';

import { auto1688stor } from '#/store';

const auto1688 = auto1688stor();
const { bindShopList } = auto1688.auto1688;
// const selectShop = ref<any>(nowSelectDyShop?.shopId);
// const searchForm = reactive({
//   platformCode: '',
//   orderType: '',
//   shopId: selectShop.value,
//   shopName: '',
//   dyOrderStatus: '',
//   aliOrderStatus: '',
//   goodsTitle: '',
//   dyOrderId: '',
// });
const fieldNames = {
  label: 'shopName',
  value: 'shopId',
};
const tabInfoDatas = inject('tabInfoDatas') as any;
const { selectShop, searchForm, getList, resetParams } = tabInfoDatas;
</script>

<template>
  <div>
    <a-form layout="inline">
      <a-form-item class="mb-2" label="订单来源店铺" style="margin-bottom: 5px">
        <a-select
          v-model:value="selectShop"
          :field-names="fieldNames"
          :options="bindShopList.filter((item) => item.pType === 2)"
          style="width: 180px"
        />
      </a-form-item>

      <a-form-item class="mb-2" label="商品名称" style="margin-bottom: 5px">
        <a-input
          v-model:value="searchForm.goodsTitle"
          allow-clear
          placeholder="请输入商品名称"
        />
      </a-form-item>
      <a-form-item class="mb-2" label="店铺订单ID" style="margin-bottom: 5px">
        <a-input
          v-model:value="searchForm.orderType"
          allow-clear
          placeholder="请输入"
        />
      </a-form-item>
      <a-form-item class="mb-2" label="店铺商品ID" style="margin-bottom: 5px">
        <a-input
          v-model:value="searchForm.productId"
          allow-clear
          placeholder="请输入"
        />
      </a-form-item>
      <!-- <a-form-item class="mb-2" label="来源订单id" style="margin-bottom: 5px">
        <a-input
          v-model:value="searchForm.dyOrderId"
          allow-clear
          placeholder="请输入"
        />
      </a-form-item> -->

      <!-- <a-form-item class="mb-2" label="来源订单状态">
        <a-select
          v-model:value="searchForm.dyOrderStatus"
          :field-names="{
            label: 'name',
            value: 'status',
          }"
          :options="statusOptionDouDian"
          style="width: 180px"
        />
      </a-form-item>

      <a-form-item class="mb-2" label="货源订单状态">
        <a-select
          v-model:value="searchForm.aliOrderStatus"
          :field-names="{
            label: 'name',
            value: 'aliStatus',
          }"
          :options="statusOption1688"
          style="width: 180px"
        />
      </a-form-item> -->

      <a-form-item class="mb-2">
        <a-button class="mr-2" @click="resetParams">重置</a-button>
        <a-button class="mr-2" type="primary" @click="getList"> 搜索 </a-button>
        <!-- <a-button class="mr-2" type="primary" @click="getDouyinOrderListFun">
          同步订单
        </a-button>
        <a-button class="mr-2" type="primary" @click="asyncOrderStatusApi">
          同步第三方状态
        </a-button> -->
      </a-form-item>
    </a-form>
  </div>
</template>
